﻿@model HCQ2_Model.T_DocumentFolder
@{
    ViewBag.Title = "文档管理";
}
@section headerSection{
    <link href="~/Resources/mainFrame/js/plugins/zTree3/css/demo.css" rel="stylesheet" />
    <link href="~/Resources/mainFrame/js/plugins/zTree3/css/metroStyle/metroStyle.css" rel="stylesheet" />
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.core.min.js"></script>
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.excheck.min.js"></script>
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.exedit.min.js"></script>
    <script src="~/Resources/tools/search_zTree.js"></script>
    <style>
        body{
            font-family:'微软雅黑';
            font-size:14px;
            color:#676a6c;
        }
        a{
            font-size:15px;
        }
        .float-unit {
            height: 100%;
            border: 1px solid #E7EAEC;
            border-top-width: 0px;
            border-bottom-width: 0px;
            margin-bottom: 0px;
        }

        .left-sm-3 {
            padding-left: 0px;
        }

        .right-sm-9 {
            padding-right: 0px;
        }

        .ibox-unit {
            overflow-y: auto;
            height: 89%;
            padding: 0px;
        }

        #exampleToolbar div {
            margin-bottom: 0px;
        }

        #exampleToolbar > .form-group {
            float: left;
            margin: 0;
            margin-right: 5px;
            margin-top: 1px;
        }

        .form-group > button {
            margin-top: -2px;
            margin-bottom: 2px;
        }
        #unitTreezTreeData{
            border:0;
            border-top:1px solid #E7EAEC;
            background:#FFFFFF;
        }
        #unitTreezTreeData li{
            line-height:28px;
        }
        #unitTreezTreeData li:hover{
            background:#F5F5F5;
        }
        #search_condition{
            width:99%;
        }
        .selectTreezTreeLI{
            background-color:#2DC1C3;
            color:#fff;
        }
        #nodeFormTable label{
            font-weight:bold;
        }
        .fileClass label{
            text-align:right;
        }
       #upFileForm .col-sm-7{
           margin-bottom:8px;
        }
       #bootstrap-duallistbox-selected-list_duallistbox_demo1 option , bootstrap-duallistbox-nonselected-list_duallistbox_demo1 option{
            height: 30px;
            line-height: 30px;
            padding-top: 5px;
        }
        #bootstrap-duallistbox-selected-list_duallistbox_demo1 option:hover, bootstrap-duallistbox-nonselected-list_duallistbox_demo1 option:hover{
            background-color: antiquewhite;
        }
        .buttons{
            width:100%;
        }
        .buttons button{
            width:50%;
        }
    </style>
}
<div class="wrapper animated fadeInRight autoHeight">
    <!-- Panel Other -->
    <div class="row autoHeight" style="background-color: #fff;">
        <!--选择单位-->
        <div id="unitTree" class="col-sm-3" style="width:20%;height:100%;padding:0;border:1px solid #E7EAEC;"></div>
        <div class="col-sm-9 col-sm-leftRight" style="width:80%;padding-left: 5px; margin-top: 2px;">
            <!-- Example Toolbar -->
            <div class="example">
                <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                    @{
                        List<string> folderList = (List<string>)ViewBag.elementList;
                        if (folderList.Contains("docAddPeer"))
                        {
                            <button id="docAddPeer" type="button" class="btn btn-outline btn-primary">
                                <i class="glyphicon glyphicon-plus" aria-hidden="true">添加根节点</i>
                            </button>
                        }
                        if (folderList.Contains("docAddSysPeer"))
                        {
                            <button id="docAddSysPeer" type="button" class="btn btn-outline btn-primary">
                                <i class="glyphicon glyphicon-plus" aria-hidden="true">添加根节点</i>
                            </button>
                        }
                        if (folderList.Contains("docAddChild"))
                        {
                            <button id="docAddChild" type="button" class="btn btn-outline btn-primary">
                                <i class="glyphicon glyphicon-plus" aria-hidden="true">添加子节点</i>
                            </button>
                        }
                        if (folderList.Contains("docAddSysChild"))
                        {
                            <button id="docAddSysChild" type="button" class="btn btn-outline btn-primary">
                                <i class="glyphicon glyphicon-plus" aria-hidden="true">添加子节点</i>
                            </button>
                        }
                        if (folderList.Contains("docEdit"))
                        {
                            <button id="docEdit" type="button" class="btn btn-outline btn-primary">
                                <i class="glyphicon glyphicon-pencil" aria-hidden="true">编辑节点</i>
                            </button>
                        }
                        if (folderList.Contains("docSysEdit"))
                        {
                            <button id="docSysEdit" type="button" class="btn btn-outline btn-primary">
                                <i class="glyphicon glyphicon-pencil" aria-hidden="true">编辑节点</i>
                            </button>
                        }
                        if (folderList.Contains("docDel"))
                        {
                            <button id="docDel" type="button" class="btn btn-outline btn-danger">
                                <i class="glyphicon glyphicon-trash" aria-hidden="true">删除节点</i>
                            </button>
                        }
                        if (folderList.Contains("btnSearch"))
                        {
                            <div class="form-group" style="width:120px">
                                <input id="keyword" name="keyword" type="text" class="form-control" placeholder="请输入文件名">
                            </div>
                            <div class="form-group" style="width:120px">
                                <input id="issue_start" name="issue_start" type="text" class="form-control laydate-icon" placeholder="发布开始">
                            </div>
                            <div class="form-group"  style="width:120px">
                                <input id="issue_end" name="issue_end" type="text" class="form-control laydate-icon" placeholder="发布截止">
                            </div>
                            <div class="form-group">
                                <button id="btnSearch" class="btn btn-primary" type="button"><i class="fa fa-search"></i>&nbsp;查询</button>
                            </div>
                        }
                        if (folderList.Contains("btnUploadFile"))
                        {
                            <div class="form-group">
                                <button id="btnUploadFile" class="btn btn-primary" type="button" disabled="disabled"><i class="fa fa-upload"></i>&nbsp;上传文档</button>
                            </div>
                        }
                        if (folderList.Contains("btnEditFile"))
                        {
                            
                            <div class="form-group">
                                <button id="btnEditFile" class="btn btn-primary" type="button"><i class="fa fa-pencil"></i>&nbsp;编辑</button>
                            </div>
                        }
                        if (folderList.Contains("btnDeleteFile"))
                        {
                            <div class="form-group">
                                <button id="btnDeleteFile" class="btn btn-danger" type="button"><i class="fa fa-trash"></i>&nbsp;删除</button>
                            </div>
                        }
                    }
                </div>
                <table id="exampleTableToolbar" data-mobile-responsive="true" data-radio="true"></table>
            </div>
            <!-- End Example Toolbar -->
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<!--添加/编辑普通节点-->
<div id="EditNode" class="form-group" style="padding-top:20px;overflow: hidden; display: none;">
    <label class="col-sm-3 control-label">节点名称<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
    <div class="col-sm-7">
        <input id="addNode" name="addNode" type="text" class="form-control input-sm" placeholder="请输入节点名称" title="请输入节点名称" required="" aria-required="true" />
    </div>
</div>
<!-- 添加/编辑系统节点 -->
<div id="nodeForm" style="overflow-x: hidden; display: none;padding-top:15px;">
    <form class="form-horizontal m-t" id="nodeFormTable" method="post">
        <div class="form-group">
            <label class="col-sm-4 control-label">节点名称<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-5">
                <input id="name" name="name" type="text" class="form-control input-sm" placeholder="请输入节点名称" title="请输入节点名称" required="" aria-required="true" />
                <input type="hidden" id="pId" name="pId" value="" />
                <input type="hidden" id="pageType" name="pageType" value="" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">分享到此目录<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-5">
                <select id="was_share" name="was_share" title="请选择能否用于分享" class="form-control input-sm selectpicker" required="" aria-required="true" placeholder="请选择能否用于分享" style="padding: 5px 10px;">
                    <option value=false selected>不允许</option>
                    <option value=true>允许</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">允许创建子目录<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-5">
                <select id="if_create_child" name="if_create_child" title="请选择能否创建子目录" class="form-control input-sm selectpicker" required="" aria-required="true" placeholder="请选择能否创建子目录" style="padding: 5px 10px;">
                    <option value=true selected>允许</option>
                    <option value=false>不允许</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">允许用户编辑<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-5">
                <select id="read_only" name="read_only" title="请选择是否允许用户编辑" class="form-control input-sm selectpicker" required="" aria-required="true" placeholder="请选择是否允许用户编辑" style="padding: 5px 10px;">
                    <option value=false>允许</option>
                    <option value=true selected>不允许</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">节点类型<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-5">
                <select id="doc_type" name="doc_type" title="请选择节点类型" class="form-control input-sm selectpicker" required="" aria-required="true" placeholder="请选择节点类型" style="padding: 5px 10px;">
                    <option value="0" selected>我的文档</option>
                    <option value="1">我的分享</option>
                    <option value="2">分享文档</option>
                    <option value="3">公用文档</option>
                    <option value="4">回收站</option>
                    <option value="5">待审核资源</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">系统节点<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-5">
                <select id="if_sys" name="if_sys" title="请选择是否允许用户编辑" class="form-control input-sm selectpicker" required="" aria-required="true" placeholder="请选择是否允许用户编辑" style="padding: 5px 10px;">
                    <option value=false>普通节点</option>
                    <option value=true selected>系统节点</option>
                </select>
            </div>
        </div>
        <p style="color:red; padding-left:20px; padding-right:20px;">温馨提示：节点类型>我的文档：内容仅自己可见，分享文档：别人分享给自己的文档，公用文档：全员可见</p>
    </form>
</div>
<!--分享设置-->
<div id="createDataBySel" style="width: 650px;overflow: hidden; display: none;">
    <div class="col-md-12">
        <select multiple="multiple" size="15" name="duallistbox_demo1" style="height: 250px;" class="demo1 listSel"></select>
    </div>
</div>
<!--文档预览-->
<div id="wordFiles" style="display:none;"></div>
<!--播放器-->
<div id="video" style="display:none;">
    <video id="vide_src"  preload="preload" loop="loop" controls="controls">
        <source src="">
    </video>
</div>
@section footSection{
    <script src="~/Resources/x-editable/js/bootstrap-editable.js"></script>
    <script src="~/Resources/duallistbox/jquery.bootstrap-duallistbox.min.js"></script>
    <script src="~/Resources/myScript/Doc/docManager.js"></script>
    <script>
        var userID = "@ViewBag.userID", isDocSys = "@ViewBag.isdocManager";
        $(function () {
            //初始化页面
            docManager.initPage(userID, isDocSys);
        });
    </script>
}